package com.core.model.lxf;

import com.core.model.AbstractEntity;

import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: lxf
 * Date: 2016/12/30
 * Time: 16:26
 * To change this template use Editor | File and Code Templates.
 */
@Entity
@Table(name = "account_transfer_details")
public class AccountTransferDetails extends AbstractEntity {

    @OneToOne
    @JoinColumn(name = "source_account_id")
    private Account sourceAccount;
    @OneToOne
    @JoinColumn(name = "target_account_id")
    private Account targetAccount;
    @Column
    private double amount;   //转账金额
    @Column(columnDefinition = "bit")
    private Boolean result = Boolean.FALSE;    //转账结果

    public AccountTransferDetails() {
    }

    public AccountTransferDetails(Account sourceAccount, Account targetAccount, double amount, boolean result) {
        this.sourceAccount = sourceAccount;
        this.targetAccount = targetAccount;
        this.amount = amount;
        this.result = result;
    }

    public Account getSourceAccount() {
        return sourceAccount;
    }

    public void setSourceAccount(Account sourceAccount) {
        this.sourceAccount = sourceAccount;
    }

    public Account getTargetAccount() {
        return targetAccount;
    }

    public void setTargetAccount(Account targetAccount) {
        this.targetAccount = targetAccount;
    }

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    public Boolean getResult() {
        return result;
    }

    public void setResult(Boolean result) {
        this.result = result;
    }
}
